<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta content="text/html; charset=UTF-8" http-equiv="content-type" />
		<title>Webappkit 0.8.0</title>
		<link rel="stylesheet" type="text/css" href="static/css/webappkit.web.css" media="screen" />
	</head>
	<body>
		<div id="header">
			<h1><span>WebAppKit</span></h1>
			<p class="baseline">Build web apps the way you want it.</p>
		</div>
		<div id="content">
			<div class="main">
				<p>Welcome to your webappkit root folder. Installed version is <em>alpha</em> 0.8.0</p>
				<p>Later on, this place will provide a full web administration interface.
				Currently, it's a static pages trying to provide some useful informations.</p>
				
				<h2 id="using-a-kit">Using a Kit</h2>
				<p>Unzip webappkit at the root of your web application. 
				It's probably done as the file you're reading is part of it. 
				It creates a webappkit/ folder. Before retrieving any Kit, put this line into your code :</p>
				<code>include('webappkit/include-me.php');</code>
				<p>When you need a Kit's resource, let's say <em>ooxmlrpc</em>, get it with :</p>
				<code>webappkit::getKit('ooxmlrpc');</code>
				<p>If you need only a subkit, let's say <em>http</em> within <em>databeans</em> within <em>webappkit</em>, get it with :</p>
				<code>webappkit::getKit('webappkit/databeans/http');</code>
				<p>In this exemple, <em>webappkit/databeans/http</em> requires <em>webappkit/databeans/databean</em>, but you don't have to take care.</p>
				
				<h2 id="building-a-kit">Building a Kit</h2>
				<p>Let's build a Kit named <em>mykit</em>, which will contain a couple of class definition files.
				<ol>
					<li>
						<p>Create a folder named <strong>mykit.wak</strong> within your <em>webappkit/</em> folder.</p>
					</li>
					<li>
						<p>Put your code files inside, let's say <strong>myclass.class.php</strong> and <strong>mychildclass.class.php</strong> which is extending it.</p>
					</li>
					<li>
						<p>Create an INI file at its root named <strong>wak.ini</strong> and edit it :</p>
						<code>[load_kits]
0 = "webappkit/datapath"

[load_files]
0 = "myclass.class.php"
1 = "mychildclass.class.php"
</code>
						<p>This file describe Kit's resources and dependancies.
						Kits and files will be loaded in the order you defined.</p>
					</li>
				</ol>
				<p>Here we're done with the main kit.</p>
				<p>Optionaly we can create a script which will be ran when the subkit instance will be created : name it <strong>wak.init.php</strong>.</p>
				<p>Please note that Kits are singleton and won't be instanciated twice.</p>
				
			<h2 id="building-a-subkit">Building a subkit</h2>
							<p>It will also require another kit, <em>webappkit/datapath</em>, and provide an extension as an optional subkit named <em>mysubkit</em>.</p>
				<ol>
					<li>
						<p>Into <em>mykit.wak/</em>, create a folder named <strong>mysubkit.wak</strong></p>
					</li>
					<li>
						<p>Put its own code files into it, for example <strong>anotherclass.php4</strong> and <strong>anotherclass.php5</strong>, which are PHP4 and PHP5 versions of the same class.</p>
					</li>
					<li>
						<p>Create its <strong>wak.ini</strong> file at its root :</p>
						<code>[load_kits]
0 = "mykit"
1 = "webappkit/pathnodes"

[load_files]
0 = "anotherclass.php*"</code>
						<p>As you see, this subkit requires its parent kit and anotherkit, <em>webappkit/pathnodes</em>.
						It also requires <em>webappkit/datapath</em>, but this dependancy is already defined by parent kit.</p>
						<p>Using * at the end of the file name will trigger the load of .php4 or .php5, upon the current running PHP version.</p>
					</li>
				</ol>
				<p>A subkit may contain itself a subkit and so on.</p>
				<p>If we want the parent kit <em>mykit</em> to load its subkit when loaded itself, we can add this into <em>mykit</em>'s wak.ini file :</p>
				<code>[load_subkits]
0 = "mysubkit"</code>
				<p>The subkit will be loaded <strong>after</strong> paren'ts kit dependancies and own files.</p>
			</div>
			
			<div class="sub">
			
				<ul class="nav">
					<li><a href="#using-a-kit">Using a Kit</a></li>
					<li><a href="#building-a-kit">Building a Kit</a></li>
					<li><a href="#building-a-subkit">Building a subkit</a></li>
				</ul>
			
				<h3>Links</h3>
				<ul class="nav">
					<li><a href="http://webappkit.net">Project home</a>
					<li>Read the <a href="http://blog.webappkit.net">blog</a> for last news.</li>
					<li>Read the <a href="http://code.webappkit.net" hreflang="en">core kit documentation</a>.</li>
				</ul>
				
				<h3>Provided Kits</h3>
				<dl>
					<dt>ooxmlrpc</dt>
					<dd>An object_oriented XML-RPC library</dd>
					<dt>xpathdoc</dt>
					<dd>Access XML document as objects, with XPath syntax</dd>
					<dt>webappkit/databeans</dt>
					<dd>Data structures with auto-validation and formatting. Includes http, datetime, sqlrecord subkits.</dd>
					<dt>webappkit/datapath</dt>
					<dd>Access tree data structures (arrays and objects) with a dot syntax.</dd>
					<dt>webappkit/djangotpl</dt>
					<dd><a href="http://djangoproject.com">Django</a> template engine partial implementation.</dd>
					<dt>webappkit/pathnodes</dt>
					<dd>Filesystem elements as objects. Includes common, ini, w3clog, yaml subkits.</dd>
				</dl>
			</div>
		</div>
	</body>
</html>
